<template>
    <div>
        <CanvasEditor
                @directionChange="directionChange" @paperMargin="paperMargin" :direction="direction"
                :editMode="editMode" ref="wordEditor" :htmlData="htmlData" :key="keys" @save="save"></CanvasEditor>
    </div>
</template>

<script>
import CanvasEditor from '@/components/CanvasEditor/index';
export default {
    components: {
        CanvasEditor
    },
    mounted() {
        let _this = this;
    },
    methods: {
        save(htmlVal){
            console.log(JSON.stringify(htmlVal));
        },
        directionChange(e){
            console.log(e);
        },
        paperMargin(left, top, right, bottom){
            console.log(left, top, right, bottom);
        }
    },

    data() {
        return {
            direction: 'vertical',

            editMode: 0,
            htmlData: `{"header":[],"main":[],"footer":[]}`,
            keys: new Date().getTime(),
        }
    }
}
</script>

<style scoped>
</style>
